package org.jeecg.config.SqlFilter;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Auther: GMY
 * @Date: 2022/09/15/14:24
 * @Description: sql注入防护开关工具类
 */
@Component
public class SqlFilterConfigUtils {
    /**
     * sql注入防护开关配置
     */
    public static Boolean openSqlProtect;

    /**
     * sql注入防护开关配置，默认为开启
     */
    public static Boolean getOpenSqlProtect() {
        return openSqlProtect == null ? true : openSqlProtect;
    }

    @Value("${open.sql.protect}")
    public void setOpenSqlProtect(Boolean openSqlProtect) {
        SqlFilterConfigUtils.openSqlProtect = openSqlProtect;
    }
}